// pages/detail/detail.js
var utils = require('../../utils/util.js');

var requestPath = utils.requestPath;

Page({
  data: {
    newsId: '',
    carouselImage:'',
    title:''
  },
  onLoad: function (options) {
    // 页面初始化 options为页面跳转所带来的参数
    var that = this;

    that.setData({
      newsId: options.id,
      carouselImage: options.carouselImage.replace("ss_", "s_"),
      title: options.title,
      url: "https://lkgnews.cn/api/share?newsId=" + options.id
    });

  },
  onReady: function () {
    // 页面渲染完成
  },
  onShow: function () {
    // 页面显示
  },
  onHide: function () {
    // 页面隐藏
  },
  onUnload: function () {
    // 页面关闭
  },
  onShareAppMessage: function () {
    var that = this;

    return {
      title: that.data.title,
      imageUrl: that.data.carouselImage,
    }
  }
})